# -*- encoding: utf-8 -*-
# @Author: XieYinJie @ProjectName: 毕业设计 @DateTime: 2020/8/28 17:20
# 爬虫接入
from webSpiderFacility.BaiDuSearch.GetContents import SearchBaiDu
from webSpiderFacility.BIYingSearch.searchByBiYing import SearchBiYing

class JudmentSpider:
    def __init__(self):
        self.baidu = SearchBaiDu()
        self.biying = SearchBiYing()

    def spider_judment(self, SpiderName, search, page=1):
        if SpiderName == '百度':
            datas = self.baidu.parseInfoList(search, page)
            return datas
        elif SpiderName == '必应':
            datas = self.biying.parseInfoList(search, page)
            return datas

# datas = [
#     {'title': '百度贴吧', 'contents': '百度贴吧内容', 'url': 'https://baidu.tieba.com'},
#     {'title': '网易游戏', 'contents': '我的世界', 'url': 'https://wangyi.myworld.com'},
#     {'title': '哔哩哔哩', 'contents': '小漫迷呦', 'url': 'https://bilibili.com'}
# ]
